<template>
  <div>
    <a-card>
      <a-row style="margin-bottom: 10px">
        <a-col :span="24"  style="display: flex;flex-direction: row-reverse">
          <a-button v-print="'#printReport'" type="primary">打印报表</a-button>
        </a-col>
      </a-row>
      <div id="printReport">
        <table border="1" cellPadding="5" cellSpacing="0" bordercolor="#000" style="width: 100%">
          <tr>
            <th colspan="24">
              <div style="position: relative;text-align: center">
                <img src="@/assets/zs.png" width="100px" height="26px" style="position: absolute;left: 0px;top:-4px"/>
                <span>控制器首、巡、末件检验记录表</span>
              </div>
            </th>
          </tr>
          <tr align="center">
            <td rowspan="2">日期</td>
            <td rowspan="2">产品名称/顾客</td>
            <td rowspan="2">状态号</td>
            <td rowspan="2">数量</td>
            <td rowspan="2">分类</td>
            <td colspan="3">物料确认</td>
            <td colspan="6">功能确认</td>
            <td colspan="6">外观确认</td>
            <td rowspan="2">判定</td>
            <td rowspan="2">其它（请注明）</td>
            <td rowspan="2">生产签字确认</td>
            <td rowspan="2">质量签字确认</td>
          </tr>
          <tr>
            <td>PCB板</td>
            <td>物料</td>
            <td>BOM表</td>
            <td>焊接效果</td>
            <td>程序烧写</td>
            <td>功能检测</td>
            <td>耐压绝缘</td>
            <td>限流值</td>
            <td>欠压值</td>
            <td>外观尺寸</td>
            <td>线束</td>
            <td>密封效果</td>
            <td>铭牌</td>
            <td>刻字</td>
            <td>包装</td>
          </tr>
          <tr v-for="item in reportData">
            <td>{{ item.createTime }}</td>
            <td>{{ item.customer }}</td>
            <td>{{ item.statusNum }}</td>
            <td>{{ item.num }}</td>
            <td>
              <div style="display:flex;justify-content: space-around;pointer-events: none;">
                <a-radio-group v-model="item.type" :options="checkedList"/>
              </div>
            </td>
            <td>{{ item.project01 === '1' ? '√' : '×'}}</td>
            <td>{{ item.project02 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project03 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project04 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project05 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project06 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project07 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project08 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project08 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project10 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project11 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project12 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project13 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project14 === '1' ? '√' : '×' }}</td>
            <td>{{ item.project15 === '1' ? '√' : '×' }}</td>
            <td>
              <div style="display:flex;justify-content: space-around;pointer-events: none;">
                <a-radio-group v-model="item.decide" :options="hsf"/>
              </div>
            </td>
            <td>{{ item.remarks }}</td>
            <td></td>
            <td></td>
          </tr>

        </table>
      </div>
    </a-card>
  </div>
</template>

<script>
export default {
  /** 宗申 **/
  name: 'zsReport',
  props:{
    reportData:{
      type:Array,
      default:()=>[]
    }
  },
  data(){
    return {
      checkedList:[
        { label: '首件', value: '首件' },
        { label: '巡件', value: '巡件' },
        { label: '末件', value: '末件' },
      ],
      hsf:[
        { label: 'OK', value: 'OK' },
        { label: 'NG', value: 'NG' },
      ],
    }
  }
}
</script>

<style scoped>

</style>